g13aaf

g13aaf © Numerical Algorithms Group, 2002.

Purpose

G13AAF Univariate time series, seasonal and non-seasonal differencing

Synopsis

[xd,nxd,ifail] = g13aaf(x,nd,nds,ns<,ifail>)

Description

 
            D       s                                            
 Let (nabla) (nabla) x  be the ith value of a time series x , for 
            s         i                                    i     
 i=1,2,...,n after non-seasonal differencing of order d and 
 seasonal differencing of order D (with period or seasonality s). 
 In general,
 
        d       D          d-1       D            d-1       D 
 (nabla) (nabla) x =(nabla)   (nabla) x   -(nabla)   (nabla) x d>0
                s i                  s i+1                  s i
 
        d       D          d       D-1            d       D-1 
 (nabla) (nabla) x =(nabla) (nabla)   x   -(nabla) (nabla)   x D>0
                s i                s   i+s                s   i
 
 Non-seasonal differencing up to the required order d is obtained 
 using
 
        1                    
 (nabla) x =x   -x                            for i=1,2,...,(n-1)
          i  i+1  i           
 
        2          1            1 
 (nabla) x =(nabla) x   -(nabla) x            for i=1,2,...,(n-2)
              i      i+1          i
 
     .         
 
     .         
 
     .         
 
        d          d-1            d-1 
 (nabla) x =(nabla)   x   -(nabla)   x        for i=1,2,...,(n-d)
          i            i+1            i
 
 Seasonal differencing up to the required order D is then obtained
 using
 
        d       1         d             d 
 (nabla) (nabla) x =(nabla) x   -(nabla) x    for i=1,2,...,(n-d-s)
                s i          i+s        i
 
        d       2          d       1            d       1 
 (nabla) (nabla) x =(nabla) (nabla) x   -(nabla) (nabla) x 
                s i                s i+s                s i
                                             for i=1,2,...,(n-d-2s)
 
     .         
 
     .         
 
     .         
 
        d       D          d       D-1            d       D-1 
 (nabla) (nabla) x =(nabla) (nabla)   x   -(nabla) (nabla)   x 
                s i                s   i+s                s   i
                                            for i=1,2,...,(n-d-Ds)
 
 Mathematically, the sequence in which the differencing operations
 are performed does not affect the final resulting series of m=n-
 d-D*s values.
 

Parameters

g13aaf

Required Input Arguments:

x (:)                                 real
nd                                    integer
nds                                   integer
ns                                    integer

Optional Input Arguments:                       <Default>

ifail                                 integer  -1

Output Arguments:

xd (:)                                real
nxd                                   integer
ifail                                 integer